package com.jinsi.controller.ylt;

import com.jinsi.constant.YltConstant;
import com.jinsi.pojo.InfoDataUser;
import com.jinsi.service.ylt.InfoDataUserService;
import com.jinsi.util.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @ClassName InfoDataUserController
 * @Content 用户统计展示数据业务实现类
 * @Author 姚龙腾
 * @Date 2022/10/12 11:53
 */
@RestController
@RequestMapping("/YltUser")
@Slf4j
public class InfoDataUserController {
    @Autowired
    private InfoDataUserService infoDataUserService;


    /**
     * 获取7天内的注册用户个数
     * @param insider
     * @return R
     */
    @RequestMapping("/InfoManage/getInfoDataByInsider")
    public R getInfoDataUserByInsider(Integer insider){
        List<InfoDataUser> list = infoDataUserService.getInfoDataUserByInsider(insider);
        return R.custom(YltConstant.LAYUI_CODE,
                YltConstant.LAYUI_MSG,
                list,
                (long) list.size());
    }


    /**
     * 获取7天内每天的封停和解封用户个数
     * @param sealState
     * @return R
     */
    @RequestMapping("/InfoManage/getInfoDataUserSeal")
    public R getInfoDataUserSeal(Integer sealState){
        List<InfoDataUser> list = infoDataUserService.getInfoDataUserSeal(sealState);
        return R.custom(YltConstant.LAYUI_CODE,
                YltConstant.LAYUI_MSG,
                list,
                (long) list.size());
    }
}
